Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

189
Visualizações
How to disable "branchesTrue" property in jest coverage-summary.json

I am trying to generate a coverage-summary.json file using jest but I noticed something new with it...

total now shows a fifth property called branchesTrue. This didn't happen before and I can't pinpoint what version of jest it started writing this property when generating the report.

Looking into the node module called istanbul-lib-coverage and under the file file-coverage.js on line 304 I can see a comment saying that the branch truthiness can be optionally enabled... I suppose it could also mean that this should have been disabled by default or be optionally disabled.

It is not much of a huge problem but I just wanted to know how I can not show this when generating the coverage report without deleting it manually or commenting out this particular line of code in the node_modules directory.

I take this to be fairly new as well since the a comment under node_modules/istanbul-lib-coverage/lib/coverage-summary.js on line 40 says that it should only be four properties:

"CoverageSummary provides a summary of code coverage . It exposes 4 properties, lines, statements, branches, and functions. Each of these properties is an object that has 4 keys total, covered, skipped and pct. pct is a percentage number (0-100)."

before:

"total": {
    "lines": { "total": 3, "covered": 3, "skipped": 0, "pct": 100 },
    "statements": { "total": 3, "covered": 3, "skipped": 0, "pct": 100 },
    "functions": { "total": 1, "covered": 1, "skipped": 0, "pct": 100 },
    "branches": { "total": 0, "covered": 0, "skipped": 0, "pct": 100 }
  }

now:

"total": {
    "lines": { "total": 3, "covered": 3, "skipped": 0, "pct": 100 },
    "statements": { "total": 3, "covered": 3, "skipped": 0, "pct": 100 },
    "functions": { "total": 1, "covered": 1, "skipped": 0, "pct": 100 },
    "branches": { "total": 0, "covered": 0, "skipped": 0, "pct": 100 },
    "branchesTrue": { "total": 0, "covered": 0, "skipped": 0, "pct": "Unknown" }
  }

Any help is much appreciated...

about 4 years ago · Santiago Gelvez
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda